from HandlePlat.RemovePack import RemovePack
from HandlePlat.DownloadPack import DownloadPack

def handle(url, suggestions):
    removelist = []
    downloadlist = []
    for cmd in suggestions:
        if cmd.startswith('-'):
            pack = cmd.split(' ')[-1].lstrip().rstrip()
            removelist.append(pack)
        if cmd.startswith('+'):
            pack = cmd.split(' ')[-1].lstrip().rstrip()
            downloadlist.append(pack)
    RemovePack(url,removelist).remove()
    DownloadPack(url, downloadlist).download()